跳到主要内容

zsh 记录

Mini


export ZSH="$HOME/.oh-my-zsh"

#ZSH_THEME="agnoster"
ZSH_THEME="powerlevel10k/powerlevel10k"

if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

plugins=(
autojump
git
bundler
dotenv
rake
rbenv
ruby
dirhistory
cp
vscode
macos
macports
man
python
composer
z
iterm2

extract

zsh-syntax-highlighting
zsh-autosuggestions
)

#extract x 解压任何文件

#设置历史命令记录数
export HISTSIZE=5000
#记录历史文件大小
export HISTFILESIZE=450
#忽略重复
export HISTCONTROL=ignoredups

# 历史搜索(使用上下箭头)
autoload -U up-line-or-beginning-search
autoload -U down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey "^[[A" up-line-or-beginning-search
bindkey "^[[B" down-line-or-beginning-search

# source $ZSH/templates/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# source $ZSH/templates/zsh-autosuggestions/zsh-autosuggestions.zsh

export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'

source $ZSH/oh-my-zsh.sh



eval "$(mcfly init zsh)"


JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home
PATH=$JAVA_HOME/bin:$PATH:.
CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:.
export JAVA_HOME
export PATH
export CLASSPATH


export ANDROID_HOME=~/Android/sdk
export PATH=${PATH}:${ANDROID_HOME}/platform-tools
export PATH=${PATH}:${ANDROID_HOME}/tools
export PATH=${PATH}:${ANDROID_HOME}/build-tools/28.0.1



export PATH=~/development/flutter/bin:$PATH
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn




export THEOS=/opt/theos
export PATH=/opt/theos/bin/:$PATH

export MonkeyDevPath=/opt/MonkeyDev
#export MonkeyDevDeviceIP=
export PATH=/opt/MonkeyDev/bin:$PATH


#go语言安装主根目录
export GOROOT=/usr/local/go #替换你的目录
#GOPATH 是自己的go项目路径,自定义设置
export GOPATH=~/go/
export PATH=$PATH:$GOPATH/bin
#GOBIN 当我们使用go install命令编译后并且安装的二进制程序目录
export GOBIN=$GOPATH/bin
# 启用 Go Modules 功能
export GO111MODULE=on
# 配置 GOPROXY 环境变量
export GOPROXY=https://goproxy.cn,direct
export PATH=$PATH:$GOROOT/bin:$GOBIN


# #rust 镜像
# export RUSTUP_DIST_SERVER="https://rsproxy.cn"
# export RUSTUP_UPDATE_ROOT="https://rsproxy.cn/rustup"

# export PATH=$PATH:$GOROOT/bin:$GOBIN:~/nushell


# .net mono
# export PATH="/Library/Frameworks/Mono.framework/Versions/6.12.0/bin:$PATH"

#conda
# __conda_setup="$('/opt/homebrew/Caskroom/miniconda/base/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
# if [ $? -eq 0 ]; then
# eval "$__conda_setup"
# else
# if [ -f "/opt/homebrew/Caskroom/miniconda/base/etc/profile.d/conda.sh" ]; then
# . "/opt/homebrew/Caskroom/miniconda/base/etc/profile.d/conda.sh"
# else
# export PATH="/opt/homebrew/Caskroom/miniconda/base/bin:$PATH"
# fi
# fi
# unset __conda_setup



# vm_envs start
if [ -z $VM_DISABLE ]; then
. /Users/arick/.vm/vm_env.sh
fi
# vm_envs end

export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"


function proxy_on() {
export http_proxy=http://127.0.0.1:7890
export https_proxy=$http_proxy
export all_proxy=socks5://127.0.0.1:7890
export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
export ftp_proxy=$http_proxy
export rsync_proxy=$http_proxy
export HTTP_PROXY=$http_proxy
export HTTPS_PROXY=$http_proxy
export FTP_PROXY=$http_proxy
export RSYNC_PROXY=$http_proxy
echo -e "终端代理已开启。"
}

function proxy_off(){
unset http_proxy https_proxy all_proxy ftp_proxy rsync_proxy
echo -e "终端代理已关闭。"
}

插件

$ZSH_CUSTOM/plugins/zsh-autosuggestions 位置

cd ~/.oh-my-zsh/custom/plugins

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git

git clone git://github.com/zsh-users/zsh-autosuggestions

vim .zshrz

plugins=(
git
zsh-syntax-highlighting
zsh-autosuggestions
)

powerlevel10k

安装

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k


在 ~/.zshrc 设置 ZSH_THEME="powerlevel10k/powerlevel10k"

头部写入
source "$ZSH/custom/themes/powerlevel10k/powerlevel10k.zsh-theme"

字体

[fonts/Meslo Slashed/Meslo LG M Regular for Powerline.ttf at master · powerline/fonts · GitHub](https://github.com/powerline/fonts/blob/master/Meslo Slashed/Meslo LG M Regular for Powerline.ttf)

https://github.com/SpaceTimee/Fusion-JetBrainsMapleMono

https://github.com/subframe7536/maple-font

打开iTerm2,打开Preferences配置界面,然后Profiles -> Text -> Font -> Chanage Font,选择 Meslo LG M Regular for Powerline 字体

透明背景

iTerm2 -> Preferences -> Profiles -> Window -> Transparency

command + enter 进入与返回全屏模式
command + t 新建标签
command + w 关闭标签
command + 数字 command + 左右方向键 切换标签
command + enter 切换全屏
command + f 查找
command + d 水平分屏
command + shift + d 垂直分屏
command + option + 方向键 command + [ 或 command + ] 切换屏幕
command + ; 查看历史命令
command + shift + h 查看剪贴板历史
ctrl + u 清除当前行
ctrl + l 清屏
ctrl + a 到行首
ctrl + e 到行尾
ctrl + f/b 前进后退
ctrl + p 上一条命令
ctrl + r 搜索命令历史